package com.cooba.dialog;

import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.LinearInterpolator;
import android.widget.ImageView;
import android.widget.TextView;

import com.cooba.R;
import com.cooba.bean.SignBean;

/**
 * Created by Administrator on 2016/6/15.
 */
public class RedWalletDialog extends Dialog implements
        OnClickListener {
    int layoutRes;// 布局文件
    Context context;
    private ImageView mGetRedWalletBtn;
    private DialogListener listener;


    public RedWalletDialog(Context context) {
        super(context);
        this.context = context;
    }

    /**
     * 自定义布局的构造方法
     *
     * @param context
     * @param resLayout
     */
    public RedWalletDialog(Context context, int resLayout) {
        super(context);
        this.context = context;
        this.layoutRes = resLayout;
    }

    /**
     * 自定义主题及布局的构造方法
     *
     * @param context
     * @param theme
     * @param resLayout
     */
    public RedWalletDialog(Context context, int theme, int resLayout, SignBean signBean,
                           DialogListener listener) {
        super(context, theme);
        this.context = context;
        this.layoutRes = resLayout;
        this.listener = listener;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.setContentView(layoutRes);

        // 根据id在布局中找到控件对象
        mGetRedWalletBtn = (ImageView) findViewById(R.id.get_red_wallet_btn);
        mGetRedWalletBtn.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.get_red_wallet_btn:
                listener.getRedWallet(v);
                //this.dismiss();
                break;

        }
    }

    public interface DialogListener {

        void getRedWallet(View v);
    }
}
